<html> 
<head> 
    <script src="../../OLLoader.js"></script>
    <script type="text/javascript">

    function test_read_exception(t) {
        t.plan(1);
        var parser = new OpenLayers.Format.WFSCapabilities();
        var text = '<?xml version="1.0" encoding="UTF-8"?>' +
'<ows:ExceptionReport language="en" version="1.0.0"' +
'    xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd"' +
'    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">' +
'    <ows:Exception locator="foo" exceptionCode="InvalidParameterValue">' +
'        <ows:ExceptionText>Update error: Error occured updating features</ows:ExceptionText>' +
'        <ows:ExceptionText>Second exception line</ows:ExceptionText>' +
'    </ows:Exception>' +
'</ows:ExceptionReport>';

        var obj = parser.read(text);
        t.ok(!!obj.error, "Error reported correctly");
    }
    
    function test_read(t) {
        t.plan(35);
       
        var parser = new OpenLayers.Format.WFSCapabilities();

        // GeoServer, v1.1.0
        var text = '<?xml version="1.0" encoding="UTF-8"?><wfs:WFS_Capabilities version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wfs" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ows="http://www.opengis.net/ows" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wfs http://localhost:80/geoserver/schemas/wfs/1.1.0/wfs.xsd" xmlns:it.geosolutions="http://www.geo-solutions.it" xmlns:cite="http://www.opengeospatial.net/cite" xmlns:tiger="http://www.census.gov" xmlns:sde="http://geoserver.sf.net" xmlns:topp="http://www.openplans.org/topp" xmlns:sf="http://www.openplans.org/spearfish" xmlns:nurc="http://www.nurc.nato.int" updateSequence="57"><ows:ServiceIdentification><ows:Title>GeoServer Web Feature Service</ows:Title><ows:Abstract>This is the reference implementation of WFS 1.0.0 and WFS 1.1.0, supports all WFS operations including Transaction.</ows:Abstract><ows:Keywords><ows:Keyword>WFS</ows:Keyword><ows:Keyword>WMS</ows:Keyword><ows:Keyword>GEOSERVER</ows:Keyword></ows:Keywords><ows:ServiceType>WFS</ows:ServiceType><ows:ServiceTypeVersion>1.1.0</ows:ServiceTypeVersion><ows:Fees>NONE</ows:Fees><ows:AccessConstraints>NONE</ows:AccessConstraints></ows:ServiceIdentification><ows:ServiceProvider><ows:ProviderName>The ancient geographes INC</ows:ProviderName><ows:ServiceContact><ows:IndividualName>Claudius Ptolomaeus</ows:IndividualName><ows:PositionName>Chief geographer</ows:PositionName><ows:ContactInfo><ows:Phone><ows:Voice/><ows:Facsimile/></ows:Phone><ows:Address><ows:City>Alexandria</ows:City><ows:AdministrativeArea/><ows:PostalCode/><ows:Country>Egypt</ows:Country></ows:Address></ows:ContactInfo></ows:ServiceContact></ows:ServiceProvider><ows:OperationsMetadata><ows:Operation name="GetCapabilities"><ows:DCP><ows:HTTP><ows:Get xlink:href="http://localhost:80/geoserver/wfs?"/><ows:Post xlink:href="http://localhost:80/geoserver/wfs?"/></ows:HTTP></ows:DCP><ows:Parameter name="AcceptVersions"><ows:Value>1.0.0</ows:Value><ows:Value>1.1.0</ows:Value></ows:Parameter><ows:Parameter name="AcceptFormats"><ows:Value>text/xml</ows:Value></ows:Parameter></ows:Operation><ows:Operation name="DescribeFeatureType"><ows:DCP><ows:HTTP><ows:Get xlink:href="http://localhost:80/geoserver/wfs?"/><ows:Post xlink:href="http://localhost:80/geoserver/wfs?"/></ows:HTTP></ows:DCP><ows:Parameter name="outputFormat"><ows:Value>text/xml; subtype=gml/3.1.1</ows:Value></ows:Parameter></ows:Operation><ows:Operation name="GetFeature"><ows:DCP><ows:HTTP><ows:Get xlink:href="http://localhost:80/geoserver/wfs?"/><ows:Post xlink:href="http://localhost:80/geoserver/wfs?"/></ows:HTTP></ows:DCP><ows:Parameter name="resultType"><ows:Value>results</ows:Value><ows:Value>hits</ows:Value></ows:Parameter><ows:Parameter name="outputFormat"><ows:Value>text/xml; subtype=gml/3.1.1</ows:Value><ows:Value>GML2</ows:Value><ows:Value>GML2-GZIP</ows:Value><ows:Value>SHAPE-ZIP</ows:Value><ows:Value>csv</ows:Value><ows:Value>gml3</ows:Value><ows:Value>json</ows:Value><ows:Value>text/xml; subtype=gml/2.1.2</ows:Value></ows:Parameter><ows:Constraint name="LocalTraverseXLinkScope"><ows:Value>2</ows:Value></ows:Constraint></ows:Operation><ows:Operation name="GetGmlObject"><ows:DCP><ows:HTTP><ows:Get xlink:href="http://localhost:80/geoserver/wfs?"/><ows:Post xlink:href="http://localhost:80/geoserver/wfs?"/></ows:HTTP></ows:DCP></ows:Operation><ows:Operation name="LockFeature"><ows:DCP><ows:HTTP><ows:Get xlink:href="http://localhost:80/geoserver/wfs?"/><ows:Post xlink:href="http://localhost:80/geoserver/wfs?"/></ows:HTTP></ows:DCP><ows:Parameter name="releaseAction"><ows:Value>ALL</ows:Value><ows:Value>SOME</ows:Value></ows:Parameter></ows:Operation><ows:Operation name="GetFeatureWithLock"><ows:DCP><ows:HTTP><ows:Get xlink:href="http://localhost:80/geoserver/wfs?"/><ows:Post xlink:href="http://localhost:80/geoserver/wfs?"/></ows:HTTP></ows:DCP><ows:Parameter name="resultType"><ows:Value>results</ows:Value><ows:Value>hits</ows:Value></ows:Parameter><ows:Parameter name="outputFormat"><ows:Value>text/xml; subtype=gml/3.1.1</ows:Value><ows:Value>GML2</ows:Value><ows:Value>GML2-GZIP</ows:Value><ows:Value>SHAPE-ZIP</ows:Value><ows:Value>csv</ows:Value><ows:Value>gml3</ows:Value><ows:Value>json</ows:Value><ows:Value>text/xml; subtype=gml/2.1.2</ows:Value></ows:Parameter></ows:Operation><ows:Operation name="Transaction"><ows:DCP><ows:HTTP><ows:Get xlink:href="http://localhost:80/geoserver/wfs?"/><ows:Post xlink:href="http://localhost:80/geoserver/wfs?"/></ows:HTTP></ows:DCP><ows:Parameter name="inputFormat"><ows:Value>text/xml; subtype=gml/3.1.1</ows:Value></ows:Parameter><ows:Parameter name="idgen"><ows:Value>GenerateNew</ows:Value><ows:Value>UseExisting</ows:Value><ows:Value>ReplaceDuplicate</ows:Value></ows:Parameter><ows:Parameter name="releaseAction"><ows:Value>ALL</ows:Value><ows:Value>SOME</ows:Value></ows:Parameter></ows:Operation></ows:OperationsMetadata><FeatureTypeList><Operations><Operation>Query</Operation><Operation>Insert</Operation><Operation>Update</Operation><Operation>Delete</Operation><Operation>Lock</Operation></Operations><FeatureType xmlns:tiger="http://www.census.gov"><Name>tiger:poly_landmarks</Name><Title>Manhattan (NY) landmarks</Title><Abstract>Manhattan landmarks, identifies water, lakes, parks, interesting buildilngs</Abstract><ows:Keywords><ows:Keyword>DS_poly_landmarks</ows:Keyword><ows:Keyword>poly_landmarks</ows:Keyword><ows:Keyword>landmarks</ows:Keyword><ows:Keyword>manhattan</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-74.047185 40.679648</ows:LowerCorner><ows:UpperCorner>-73.90782 40.882078</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:tiger="http://www.census.gov"><Name>tiger:poi</Name><Title>Manhattan (NY) points of interest</Title><Abstract>Points of interest in New York, New York (on Manhattan). One of the attributes contains the name of a file with a picture of the point of interest.</Abstract><ows:Keywords><ows:Keyword>poi</ows:Keyword><ows:Keyword>DS_poi</ows:Keyword><ows:Keyword>points_of_interest</ows:Keyword><ows:Keyword>Manhattan</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-74.0118315772888 40.70754683896324</ows:LowerCorner><ows:UpperCorner>-74.00857344353275 40.711945649065406</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:tiger="http://www.census.gov"><Name>tiger:tiger_roads</Name><Title>Manhattan (NY) roads</Title><Abstract>Highly simplified road layout of Manhattan in New York..</Abstract><ows:Keywords><ows:Keyword>DS_tiger_roads</ows:Keyword><ows:Keyword>tiger_roads</ows:Keyword><ows:Keyword>roads</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-74.02722 40.684221</ows:LowerCorner><ows:UpperCorner>-73.907005 40.878178</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:sf="http://www.openplans.org/spearfish"><Name>sf:archsites</Name><Title>Spearfish archeological sites</Title><Abstract>Sample data from GRASS, archeological sites location, Spearfish, South Dakota, USA</Abstract><ows:Keywords><ows:Keyword>archsites</ows:Keyword><ows:Keyword>sfArchsites</ows:Keyword><ows:Keyword>spearfish</ows:Keyword><ows:Keyword>archeology</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:26713</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-103.8725637911543 44.37740330855979</ows:LowerCorner><ows:UpperCorner>-103.63794182141925 44.48804280772808</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:sf="http://www.openplans.org/spearfish"><Name>sf:bugsites</Name><Title>Spearfish bug locations</Title><Abstract>Sample data from GRASS, bug sites location, Spearfish, South Dakota, USA</Abstract><ows:Keywords><ows:Keyword>sfBugsites</ows:Keyword><ows:Keyword>bugsites</ows:Keyword><ows:Keyword>insects</ows:Keyword><ows:Keyword>spearfish</ows:Keyword><ows:Keyword>tiger_beetles</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:26713</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-103.86796131703647 44.373938816704396</ows:LowerCorner><ows:UpperCorner>-103.63773523234195 44.43418821380063</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:sf="http://www.openplans.org/spearfish"><Name>sf:restricted</Name><Title>Spearfish restricted areas</Title><Abstract>Sample data from GRASS, restricted areas, Spearfish, South Dakota, USA</Abstract><ows:Keywords><ows:Keyword>restricted</ows:Keyword><ows:Keyword>sfRestricted</ows:Keyword><ows:Keyword>spearfish</ows:Keyword><ows:Keyword>areas</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:26713</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-103.85057172920756 44.39436387625042</ows:LowerCorner><ows:UpperCorner>-103.74741494853805 44.48215752041131</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:sf="http://www.openplans.org/spearfish"><Name>sf:roads</Name><Title>Spearfish roads</Title><Abstract>Sample data from GRASS, road layout, Spearfish, South Dakota, USA</Abstract><ows:Keywords><ows:Keyword>sfRoads</ows:Keyword><ows:Keyword>roads</ows:Keyword><ows:Keyword>spearfish</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:26713</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-103.87741691493184 44.37087275281798</ows:LowerCorner><ows:UpperCorner>-103.62231404880659 44.50015918338962</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:sf="http://www.openplans.org/spearfish"><Name>sf:streams</Name><Title>Spearfish streams</Title><Abstract>Sample data from GRASS, streams, Spearfish, South Dakota, USA</Abstract><ows:Keywords><ows:Keyword>sfStreams</ows:Keyword><ows:Keyword>streams</ows:Keyword><ows:Keyword>spearfish</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:26713</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-103.87789019829768 44.372335260095554</ows:LowerCorner><ows:UpperCorner>-103.62287788915457 44.502218486214815</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:topp="http://www.openplans.org/topp"><Name>topp:tasmania_cities</Name><Title>Tasmania cities</Title><Abstract>Cities in Tasmania (actually, just the capital)</Abstract><ows:Keywords><ows:Keyword>cities</ows:Keyword><ows:Keyword>Tasmania</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>145.19754 -43.423512</ows:LowerCorner><ows:UpperCorner>148.27298000000002 -40.852802</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:topp="http://www.openplans.org/topp"><Name>topp:tasmania_roads</Name><Title>Tasmania roads</Title><Abstract>Main Tasmania roads</Abstract><ows:Keywords><ows:Keyword>Roads</ows:Keyword><ows:Keyword>Tasmania</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>145.19754 -43.423512</ows:LowerCorner><ows:UpperCorner>148.27298000000002 -40.852802</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:topp="http://www.openplans.org/topp"><Name>topp:tasmania_state_boundaries</Name><Title>Tasmania state boundaries</Title><Abstract>Tasmania state boundaries</Abstract><ows:Keywords><ows:Keyword>tasmania_state_boundaries</ows:Keyword><ows:Keyword>Tasmania</ows:Keyword><ows:Keyword>boundaries</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>143.83482400000003 -43.648056</ows:LowerCorner><ows:UpperCorner>148.47914100000003 -39.573891</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:topp="http://www.openplans.org/topp"><Name>topp:tasmania_water_bodies</Name><Title>Tasmania water bodies</Title><Abstract>Tasmania water bodies</Abstract><ows:Keywords><ows:Keyword>Lakes</ows:Keyword><ows:Keyword>Bodies</ows:Keyword><ows:Keyword>Australia</ows:Keyword><ows:Keyword>Water</ows:Keyword><ows:Keyword>Tasmania</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>145.97161899999998 -43.031944</ows:LowerCorner><ows:UpperCorner>147.219696 -41.775558</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:topp="http://www.openplans.org/topp"><Name>topp:states</Name><Title>USA Population</Title><Abstract>This is some census data on the states.</Abstract><ows:Keywords><ows:Keyword>census</ows:Keyword><ows:Keyword>united</ows:Keyword><ows:Keyword>boundaries</ows:Keyword><ows:Keyword>state</ows:Keyword><ows:Keyword>states</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-124.731422 24.955967</ows:LowerCorner><ows:UpperCorner>-66.969849 49.371735</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType><FeatureType xmlns:tiger="http://www.census.gov"><Name>tiger:giant_polygon</Name><Title>World rectangle</Title><Abstract>A simple rectangular polygon covering most of the world, it\'s only used for the purpose of providing a background (WMS bgcolor could be used instead)</Abstract><ows:Keywords><ows:Keyword>DS_giant_polygon</ows:Keyword><ows:Keyword>giant_polygon</ows:Keyword></ows:Keywords><DefaultSRS>urn:x-ogc:def:crs:EPSG:4326</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>-180.0 -90.0</ows:LowerCorner><ows:UpperCorner>180.0 90.0</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType></FeatureTypeList><ogc:Filter_Capabilities><ogc:Spatial_Capabilities><ogc:GeometryOperands><ogc:GeometryOperand>gml:Envelope</ogc:GeometryOperand><ogc:GeometryOperand>gml:Point</ogc:GeometryOperand><ogc:GeometryOperand>gml:LineString</ogc:GeometryOperand><ogc:GeometryOperand>gml:Polygon</ogc:GeometryOperand></ogc:GeometryOperands><ogc:SpatialOperators><ogc:SpatialOperator name="Disjoint"/><ogc:SpatialOperator name="Equals"/><ogc:SpatialOperator name="DWithin"/><ogc:SpatialOperator name="Beyond"/><ogc:SpatialOperator name="Intersects"/><ogc:SpatialOperator name="Touches"/><ogc:SpatialOperator name="Crosses"/><ogc:SpatialOperator name="Contains"/><ogc:SpatialOperator name="Overlaps"/><ogc:SpatialOperator name="BBOX"/></ogc:SpatialOperators></ogc:Spatial_Capabilities><ogc:Scalar_Capabilities><ogc:LogicalOperators/><ogc:ComparisonOperators><ogc:ComparisonOperator>LessThan</ogc:ComparisonOperator><ogc:ComparisonOperator>GreaterThan</ogc:ComparisonOperator><ogc:ComparisonOperator>LessThanEqualTo</ogc:ComparisonOperator><ogc:ComparisonOperator>GreaterThanEqualTo</ogc:ComparisonOperator><ogc:ComparisonOperator>EqualTo</ogc:ComparisonOperator><ogc:ComparisonOperator>NotEqualTo</ogc:ComparisonOperator><ogc:ComparisonOperator>Like</ogc:ComparisonOperator><ogc:ComparisonOperator>Between</ogc:ComparisonOperator><ogc:ComparisonOperator>NullCheck</ogc:ComparisonOperator></ogc:ComparisonOperators><ogc:ArithmeticOperators><ogc:SimpleArithmetic/><ogc:Functions><ogc:FunctionNames><ogc:FunctionName nArgs="1">abs</ogc:FunctionName><ogc:FunctionName nArgs="1">abs_2</ogc:FunctionName><ogc:FunctionName nArgs="1">abs_3</ogc:FunctionName><ogc:FunctionName nArgs="1">abs_4</ogc:FunctionName><ogc:FunctionName nArgs="1">acos</ogc:FunctionName><ogc:FunctionName nArgs="1">Area</ogc:FunctionName><ogc:FunctionName nArgs="1">asin</ogc:FunctionName><ogc:FunctionName nArgs="1">atan</ogc:FunctionName><ogc:FunctionName nArgs="2">atan2</ogc:FunctionName><ogc:FunctionName nArgs="3">between</ogc:FunctionName><ogc:FunctionName nArgs="1">boundary</ogc:FunctionName><ogc:FunctionName nArgs="1">boundaryDimension</ogc:FunctionName><ogc:FunctionName nArgs="2">buffer</ogc:FunctionName><ogc:FunctionName nArgs="3">bufferWithSegments</ogc:FunctionName><ogc:FunctionName nArgs="0">Categorize</ogc:FunctionName><ogc:FunctionName nArgs="1">ceil</ogc:FunctionName><ogc:FunctionName nArgs="1">centroid</ogc:FunctionName><ogc:FunctionName nArgs="2">classify</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Average</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Bounds</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Count</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Max</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Median</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Min</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Sum</ogc:FunctionName><ogc:FunctionName nArgs="1">Collection_Unique</ogc:FunctionName><ogc:FunctionName nArgs="2">Concatenate</ogc:FunctionName><ogc:FunctionName nArgs="2">contains</ogc:FunctionName><ogc:FunctionName nArgs="1">convexHull</ogc:FunctionName><ogc:FunctionName nArgs="1">cos</ogc:FunctionName><ogc:FunctionName nArgs="2">crosses</ogc:FunctionName><ogc:FunctionName nArgs="2">dateFormat</ogc:FunctionName><ogc:FunctionName nArgs="2">dateParse</ogc:FunctionName><ogc:FunctionName nArgs="2">difference</ogc:FunctionName><ogc:FunctionName nArgs="1">dimension</ogc:FunctionName><ogc:FunctionName nArgs="2">disjoint</ogc:FunctionName><ogc:FunctionName nArgs="2">distance</ogc:FunctionName><ogc:FunctionName nArgs="1">double2bool</ogc:FunctionName><ogc:FunctionName nArgs="1">endPoint</ogc:FunctionName><ogc:FunctionName nArgs="1">envelope</ogc:FunctionName><ogc:FunctionName nArgs="2">EqualInterval</ogc:FunctionName><ogc:FunctionName nArgs="2">equalsExact</ogc:FunctionName><ogc:FunctionName nArgs="3">equalsExactTolerance</ogc:FunctionName><ogc:FunctionName nArgs="2">equalTo</ogc:FunctionName><ogc:FunctionName nArgs="1">exp</ogc:FunctionName><ogc:FunctionName nArgs="1">exteriorRing</ogc:FunctionName><ogc:FunctionName nArgs="1">floor</ogc:FunctionName><ogc:FunctionName nArgs="1">geometryType</ogc:FunctionName><ogc:FunctionName nArgs="1">geomFromWKT</ogc:FunctionName><ogc:FunctionName nArgs="1">geomLength</ogc:FunctionName><ogc:FunctionName nArgs="2">getGeometryN</ogc:FunctionName><ogc:FunctionName nArgs="1">getX</ogc:FunctionName><ogc:FunctionName nArgs="1">getY</ogc:FunctionName><ogc:FunctionName nArgs="1">getZ</ogc:FunctionName><ogc:FunctionName nArgs="2">greaterEqualThan</ogc:FunctionName><ogc:FunctionName nArgs="2">greaterThan</ogc:FunctionName><ogc:FunctionName nArgs="0">id</ogc:FunctionName><ogc:FunctionName nArgs="2">IEEEremainder</ogc:FunctionName><ogc:FunctionName nArgs="3">if_then_else</ogc:FunctionName><ogc:FunctionName nArgs="11">in10</ogc:FunctionName><ogc:FunctionName nArgs="3">in2</ogc:FunctionName><ogc:FunctionName nArgs="4">in3</ogc:FunctionName><ogc:FunctionName nArgs="5">in4</ogc:FunctionName><ogc:FunctionName nArgs="6">in5</ogc:FunctionName><ogc:FunctionName nArgs="7">in6</ogc:FunctionName><ogc:FunctionName nArgs="8">in7</ogc:FunctionName><ogc:FunctionName nArgs="9">in8</ogc:FunctionName><ogc:FunctionName nArgs="10">in9</ogc:FunctionName><ogc:FunctionName nArgs="1">int2bbool</ogc:FunctionName><ogc:FunctionName nArgs="1">int2ddouble</ogc:FunctionName><ogc:FunctionName nArgs="1">interiorPoint</ogc:FunctionName><ogc:FunctionName nArgs="2">interiorRingN</ogc:FunctionName><ogc:FunctionName nArgs="2">intersection</ogc:FunctionName><ogc:FunctionName nArgs="2">intersects</ogc:FunctionName><ogc:FunctionName nArgs="1">isClosed</ogc:FunctionName><ogc:FunctionName nArgs="1">isEmpty</ogc:FunctionName><ogc:FunctionName nArgs="2">isLike</ogc:FunctionName><ogc:FunctionName nArgs="1">isNull</ogc:FunctionName><ogc:FunctionName nArgs="1">isRing</ogc:FunctionName><ogc:FunctionName nArgs="1">isSimple</ogc:FunctionName><ogc:FunctionName nArgs="1">isValid</ogc:FunctionName><ogc:FunctionName nArgs="3">isWithinDistance</ogc:FunctionName><ogc:FunctionName nArgs="1">length</ogc:FunctionName><ogc:FunctionName nArgs="2">lessEqualThan</ogc:FunctionName><ogc:FunctionName nArgs="2">lessThan</ogc:FunctionName><ogc:FunctionName nArgs="1">log</ogc:FunctionName><ogc:FunctionName nArgs="2">max</ogc:FunctionName><ogc:FunctionName nArgs="2">max_2</ogc:FunctionName><ogc:FunctionName nArgs="2">max_3</ogc:FunctionName><ogc:FunctionName nArgs="2">max_4</ogc:FunctionName><ogc:FunctionName nArgs="2">min</ogc:FunctionName><ogc:FunctionName nArgs="2">min_2</ogc:FunctionName><ogc:FunctionName nArgs="2">min_3</ogc:FunctionName><ogc:FunctionName nArgs="2">min_4</ogc:FunctionName><ogc:FunctionName nArgs="1">not</ogc:FunctionName><ogc:FunctionName nArgs="2">notEqualTo</ogc:FunctionName><ogc:FunctionName nArgs="1">numGeometries</ogc:FunctionName><ogc:FunctionName nArgs="1">numInteriorRing</ogc:FunctionName><ogc:FunctionName nArgs="1">numPoints</ogc:FunctionName><ogc:FunctionName nArgs="2">overlaps</ogc:FunctionName><ogc:FunctionName nArgs="1">parseBoolean</ogc:FunctionName><ogc:FunctionName nArgs="1">parseDouble</ogc:FunctionName><ogc:FunctionName nArgs="1">parseInt</ogc:FunctionName><ogc:FunctionName nArgs="0">pi</ogc:FunctionName><ogc:FunctionName nArgs="2">pointN</ogc:FunctionName><ogc:FunctionName nArgs="2">pow</ogc:FunctionName><ogc:FunctionName nArgs="1">PropertyExists</ogc:FunctionName><ogc:FunctionName nArgs="2">Quantile</ogc:FunctionName><ogc:FunctionName nArgs="0">random</ogc:FunctionName><ogc:FunctionName nArgs="2">relate</ogc:FunctionName><ogc:FunctionName nArgs="3">relatePattern</ogc:FunctionName><ogc:FunctionName nArgs="1">rint</ogc:FunctionName><ogc:FunctionName nArgs="1">round</ogc:FunctionName><ogc:FunctionName nArgs="1">round_2</ogc:FunctionName><ogc:FunctionName nArgs="1">roundDouble</ogc:FunctionName><ogc:FunctionName nArgs="1">sin</ogc:FunctionName><ogc:FunctionName nArgs="1">sqrt</ogc:FunctionName><ogc:FunctionName nArgs="2">StandardDeviation</ogc:FunctionName><ogc:FunctionName nArgs="1">startPoint</ogc:FunctionName><ogc:FunctionName nArgs="2">strConcat</ogc:FunctionName><ogc:FunctionName nArgs="2">strEndsWith</ogc:FunctionName><ogc:FunctionName nArgs="2">strEqualsIgnoreCase</ogc:FunctionName><ogc:FunctionName nArgs="2">strIndexOf</ogc:FunctionName><ogc:FunctionName nArgs="2">strLastIndexOf</ogc:FunctionName><ogc:FunctionName nArgs="1">strLength</ogc:FunctionName><ogc:FunctionName nArgs="2">strMatches</ogc:FunctionName><ogc:FunctionName nArgs="4">strReplace</ogc:FunctionName><ogc:FunctionName nArgs="2">strStartsWith</ogc:FunctionName><ogc:FunctionName nArgs="3">strSubstring</ogc:FunctionName><ogc:FunctionName nArgs="2">strSubstringStart</ogc:FunctionName><ogc:FunctionName nArgs="1">strToLowerCase</ogc:FunctionName><ogc:FunctionName nArgs="1">strToUpperCase</ogc:FunctionName><ogc:FunctionName nArgs="1">strTrim</ogc:FunctionName><ogc:FunctionName nArgs="2">symDifference</ogc:FunctionName><ogc:FunctionName nArgs="1">tan</ogc:FunctionName><ogc:FunctionName nArgs="1">toDegrees</ogc:FunctionName><ogc:FunctionName nArgs="1">toRadians</ogc:FunctionName><ogc:FunctionName nArgs="2">touches</ogc:FunctionName><ogc:FunctionName nArgs="1">toWKT</ogc:FunctionName><ogc:FunctionName nArgs="2">union</ogc:FunctionName><ogc:FunctionName nArgs="2">UniqueInterval</ogc:FunctionName><ogc:FunctionName nArgs="2">within</ogc:FunctionName></ogc:FunctionNames></ogc:Functions></ogc:ArithmeticOperators></ogc:Scalar_Capabilities><ogc:Id_Capabilities><ogc:FID/><ogc:EID/></ogc:Id_Capabilities></ogc:Filter_Capabilities></wfs:WFS_Capabilities>';
        var res = parser.read(text);
        t.eq(res.operationsMetadata["GetFeature"].dcp.http.get[0].url, "http://localhost:80/geoserver/wfs?", "GetFeature GET endpoint correctly parsed");
        t.eq(res.operationsMetadata["GetFeature"].dcp.http.post[0].url, "http://localhost:80/geoserver/wfs?", "GetFeature POST endpoint correctly parsed");
        var ft = res.featureTypeList.featureTypes;
        t.eq(ft.length, 14, "number of feature types correct");
        t.eq(ft[0]["abstract"], "Manhattan landmarks, identifies water, lakes, parks, interesting buildilngs", "abstract of first feature type correct");
        t.eq(ft[0]["title"], "Manhattan (NY) landmarks", "title of first feature type correct");
        t.eq(ft[0]["name"], "poly_landmarks", "name of first feature type correct");
        t.eq(ft[0]["featureNS"], "http://www.census.gov", "ns of first feature type correct");
        t.eq(ft[0]["srs"], "urn:x-ogc:def:crs:EPSG:4326", "srs of first feature type correct");

        // GeoServer, v1.0.0
        text = '<?xml version="1.0" encoding="UTF-8"?><WFS_Capabilities version="1.0.0" xmlns="http://www.opengis.net/wfs" xmlns:it.geosolutions="http://www.geo-solutions.it" xmlns:cite="http://www.opengeospatial.net/cite" xmlns:tiger="http://www.census.gov" xmlns:sde="http://geoserver.sf.net" xmlns:topp="http://www.openplans.org/topp" xmlns:sf="http://www.openplans.org/spearfish" xmlns:nurc="http://www.nurc.nato.int" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://localhost:80/geoserver/schemas/wfs/1.0.0/WFS-capabilities.xsd"><Service><Name>WFS</Name><Title>GeoServer Web Feature Service</Title><Abstract>This is the reference implementation of WFS 1.0.0 and WFS 1.1.0, supports all WFS operations including Transaction.</Abstract><Keywords>WFS, WMS, GEOSERVER</Keywords><OnlineResource>http://localhost:80/geoserver/wfs</OnlineResource><Fees>NONE</Fees><AccessConstraints>NONE</AccessConstraints></Service><Capability><Request><GetCapabilities><DCPType><HTTP><Get onlineResource="http://localhost:80/geoserver/wfs?request=GetCapabilities"/></HTTP></DCPType><DCPType><HTTP><Post onlineResource="http://localhost:80/geoserver/wfs?"/></HTTP></DCPType></GetCapabilities><DescribeFeatureType><SchemaDescriptionLanguage><XMLSCHEMA/></SchemaDescriptionLanguage><DCPType><HTTP><Get onlineResource="http://localhost:80/geoserver/wfs?request=DescribeFeatureType"/></HTTP></DCPType><DCPType><HTTP><Post onlineResource="http://localhost:80/geoserver/wfs?"/></HTTP></DCPType></DescribeFeatureType><GetFeature><ResultFormat><GML2/><SHAPE-ZIP/><GEOJSON/><csv/><GML3/></ResultFormat><DCPType><HTTP><Get onlineResource="http://localhost:80/geoserver/wfs?request=GetFeature"/></HTTP></DCPType><DCPType><HTTP><Post onlineResource="http://localhost:80/geoserver/wfs?"/></HTTP></DCPType></GetFeature><Transaction><DCPType><HTTP><Get onlineResource="http://localhost:80/geoserver/wfs?request=Transaction"/></HTTP></DCPType><DCPType><HTTP><Post onlineResource="http://localhost:80/geoserver/wfs?"/></HTTP></DCPType></Transaction><LockFeature><DCPType><HTTP><Get onlineResource="http://localhost:80/geoserver/wfs?request=LockFeature"/></HTTP></DCPType><DCPType><HTTP><Post onlineResource="http://localhost:80/geoserver/wfs?"/></HTTP></DCPType></LockFeature><GetFeatureWithLock><ResultFormat><GML2/></ResultFormat><DCPType><HTTP><Get onlineResource="http://localhost:80/geoserver/wfs?request=GetFeatureWithLock"/></HTTP></DCPType><DCPType><HTTP><Post onlineResource="http://localhost:80/geoserver/wfs?"/></HTTP></DCPType></GetFeatureWithLock></Request></Capability><FeatureTypeList><Operations><Query/><Insert/><Update/><Delete/><Lock/></Operations><FeatureType><Name>tiger:poly_landmarks</Name><Title>Manhattan (NY) landmarks</Title><Abstract>Manhattan landmarks, identifies water, lakes, parks, interesting buildilngs</Abstract><Keywords>DS_poly_landmarks, poly_landmarks, landmarks, manhattan</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="-74.047185" miny="40.679648" maxx="-73.90782" maxy="40.882078"/></FeatureType><FeatureType><Name>tiger:poi</Name><Title>Manhattan (NY) points of interest</Title><Abstract>Points of interest in New York, New York (on Manhattan). One of the attributes contains the name of a file with a picture of the point of interest.</Abstract><Keywords>poi, DS_poi, points_of_interest, Manhattan</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="-74.0118315772888" miny="40.70754683896324" maxx="-74.00857344353275" maxy="40.711945649065406"/></FeatureType><FeatureType><Name>tiger:tiger_roads</Name><Title>Manhattan (NY) roads</Title><Abstract>Highly simplified road layout of Manhattan in New York..</Abstract><Keywords>DS_tiger_roads, tiger_roads, roads</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="-74.02722" miny="40.684221" maxx="-73.907005" maxy="40.878178"/></FeatureType><FeatureType><Name>sf:archsites</Name><Title>Spearfish archeological sites</Title><Abstract>Sample data from GRASS, archeological sites location, Spearfish, South Dakota, USA</Abstract><Keywords>archsites, sfArchsites, spearfish, archeology</Keywords><SRS>EPSG:26713</SRS><LatLongBoundingBox minx="-103.8725637911543" miny="44.37740330855979" maxx="-103.63794182141925" maxy="44.48804280772808"/></FeatureType><FeatureType><Name>sf:bugsites</Name><Title>Spearfish bug locations</Title><Abstract>Sample data from GRASS, bug sites location, Spearfish, South Dakota, USA</Abstract><Keywords>sfBugsites, bugsites, insects, spearfish, tiger_beetles</Keywords><SRS>EPSG:26713</SRS><LatLongBoundingBox minx="-103.86796131703647" miny="44.373938816704396" maxx="-103.63773523234195" maxy="44.43418821380063"/></FeatureType><FeatureType><Name>sf:restricted</Name><Title>Spearfish restricted areas</Title><Abstract>Sample data from GRASS, restricted areas, Spearfish, South Dakota, USA</Abstract><Keywords>restricted, sfRestricted, spearfish, areas</Keywords><SRS>EPSG:26713</SRS><LatLongBoundingBox minx="-103.85057172920756" miny="44.39436387625042" maxx="-103.74741494853805" maxy="44.48215752041131"/></FeatureType><FeatureType><Name>sf:roads</Name><Title>Spearfish roads</Title><Abstract>Sample data from GRASS, road layout, Spearfish, South Dakota, USA</Abstract><Keywords>sfRoads, roads, spearfish</Keywords><SRS>EPSG:26713</SRS><LatLongBoundingBox minx="-103.87741691493184" miny="44.37087275281798" maxx="-103.62231404880659" maxy="44.50015918338962"/></FeatureType><FeatureType><Name>sf:streams</Name><Title>Spearfish streams</Title><Abstract>Sample data from GRASS, streams, Spearfish, South Dakota, USA</Abstract><Keywords>sfStreams, streams, spearfish</Keywords><SRS>EPSG:26713</SRS><LatLongBoundingBox minx="-103.87789019829768" miny="44.372335260095554" maxx="-103.62287788915457" maxy="44.502218486214815"/></FeatureType><FeatureType><Name>topp:tasmania_cities</Name><Title>Tasmania cities</Title><Abstract>Cities in Tasmania (actually, just the capital)</Abstract><Keywords>cities, Tasmania</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="145.19754" miny="-43.423512" maxx="148.27298000000002" maxy="-40.852802"/></FeatureType><FeatureType><Name>topp:tasmania_roads</Name><Title>Tasmania roads</Title><Abstract>Main Tasmania roads</Abstract><Keywords>Roads, Tasmania</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="145.19754" miny="-43.423512" maxx="148.27298000000002" maxy="-40.852802"/></FeatureType><FeatureType><Name>topp:tasmania_state_boundaries</Name><Title>Tasmania state boundaries</Title><Abstract>Tasmania state boundaries</Abstract><Keywords>tasmania_state_boundaries, Tasmania, boundaries</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="143.83482400000003" miny="-43.648056" maxx="148.47914100000003" maxy="-39.573891"/></FeatureType><FeatureType><Name>topp:tasmania_water_bodies</Name><Title>Tasmania water bodies</Title><Abstract>Tasmania water bodies</Abstract><Keywords>Lakes, Bodies, Australia, Water, Tasmania</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="145.97161899999998" miny="-43.031944" maxx="147.219696" maxy="-41.775558"/></FeatureType><FeatureType><Name>topp:states</Name><Title>USA Population</Title><Abstract>This is some census data on the states.</Abstract><Keywords>census, united, boundaries, state, states</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="-124.731422" miny="24.955967" maxx="-66.969849" maxy="49.371735"/></FeatureType><FeatureType><Name>tiger:giant_polygon</Name><Title>World rectangle</Title><Abstract>A simple rectangular polygon covering most of the world, it\'s only used for the purpose of providing a background (WMS bgcolor could be used instead)</Abstract><Keywords>DS_giant_polygon, giant_polygon</Keywords><SRS>EPSG:4326</SRS><LatLongBoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0"/></FeatureType></FeatureTypeList><ogc:Filter_Capabilities><ogc:Spatial_Capabilities><ogc:Spatial_Operators><ogc:Disjoint/><ogc:Equals/><ogc:DWithin/><ogc:Beyond/><ogc:Intersect/><ogc:Touches/><ogc:Crosses/><ogc:Within/><ogc:Contains/><ogc:Overlaps/><ogc:BBOX/></ogc:Spatial_Operators></ogc:Spatial_Capabilities><ogc:Scalar_Capabilities><ogc:Logical_Operators/><ogc:Comparison_Operators><ogc:Simple_Comparisons/><ogc:Between/><ogc:Like/><ogc:NullCheck/></ogc:Comparison_Operators><ogc:Arithmetic_Operators><ogc:Simple_Arithmetic/><ogc:Functions><ogc:Function_Names><ogc:Function_Name nArgs="1">abs</ogc:Function_Name><ogc:Function_Name nArgs="1">abs_2</ogc:Function_Name><ogc:Function_Name nArgs="1">abs_3</ogc:Function_Name><ogc:Function_Name nArgs="1">abs_4</ogc:Function_Name><ogc:Function_Name nArgs="1">acos</ogc:Function_Name><ogc:Function_Name nArgs="1">Area</ogc:Function_Name><ogc:Function_Name nArgs="1">asin</ogc:Function_Name><ogc:Function_Name nArgs="1">atan</ogc:Function_Name><ogc:Function_Name nArgs="2">atan2</ogc:Function_Name><ogc:Function_Name nArgs="3">between</ogc:Function_Name><ogc:Function_Name nArgs="1">boundary</ogc:Function_Name><ogc:Function_Name nArgs="1">boundaryDimension</ogc:Function_Name><ogc:Function_Name nArgs="2">buffer</ogc:Function_Name><ogc:Function_Name nArgs="3">bufferWithSegments</ogc:Function_Name><ogc:Function_Name nArgs="1">ceil</ogc:Function_Name><ogc:Function_Name nArgs="1">centroid</ogc:Function_Name><ogc:Function_Name nArgs="2">classify</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Average</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Bounds</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Count</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Max</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Median</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Min</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Sum</ogc:Function_Name><ogc:Function_Name nArgs="1">Collection_Unique</ogc:Function_Name><ogc:Function_Name nArgs="2">Concatenate</ogc:Function_Name><ogc:Function_Name nArgs="2">contains</ogc:Function_Name><ogc:Function_Name nArgs="1">convexHull</ogc:Function_Name><ogc:Function_Name nArgs="1">cos</ogc:Function_Name><ogc:Function_Name nArgs="2">crosses</ogc:Function_Name><ogc:Function_Name nArgs="2">dateFormat</ogc:Function_Name><ogc:Function_Name nArgs="2">dateParse</ogc:Function_Name><ogc:Function_Name nArgs="2">difference</ogc:Function_Name><ogc:Function_Name nArgs="1">dimension</ogc:Function_Name><ogc:Function_Name nArgs="2">disjoint</ogc:Function_Name><ogc:Function_Name nArgs="2">distance</ogc:Function_Name><ogc:Function_Name nArgs="1">double2bool</ogc:Function_Name><ogc:Function_Name nArgs="1">endPoint</ogc:Function_Name><ogc:Function_Name nArgs="1">envelope</ogc:Function_Name><ogc:Function_Name nArgs="2">EqualInterval</ogc:Function_Name><ogc:Function_Name nArgs="2">equalsExact</ogc:Function_Name><ogc:Function_Name nArgs="3">equalsExactTolerance</ogc:Function_Name><ogc:Function_Name nArgs="2">equalTo</ogc:Function_Name><ogc:Function_Name nArgs="1">exp</ogc:Function_Name><ogc:Function_Name nArgs="1">exteriorRing</ogc:Function_Name><ogc:Function_Name nArgs="1">floor</ogc:Function_Name><ogc:Function_Name nArgs="1">geometryType</ogc:Function_Name><ogc:Function_Name nArgs="1">geomFromWKT</ogc:Function_Name><ogc:Function_Name nArgs="1">geomLength</ogc:Function_Name><ogc:Function_Name nArgs="2">getGeometryN</ogc:Function_Name><ogc:Function_Name nArgs="1">getX</ogc:Function_Name><ogc:Function_Name nArgs="1">getY</ogc:Function_Name><ogc:Function_Name nArgs="1">getZ</ogc:Function_Name><ogc:Function_Name nArgs="2">greaterEqualThan</ogc:Function_Name><ogc:Function_Name nArgs="2">greaterThan</ogc:Function_Name><ogc:Function_Name nArgs="0">id</ogc:Function_Name><ogc:Function_Name nArgs="2">IEEEremainder</ogc:Function_Name><ogc:Function_Name nArgs="3">if_then_else</ogc:Function_Name><ogc:Function_Name nArgs="11">in10</ogc:Function_Name><ogc:Function_Name nArgs="3">in2</ogc:Function_Name><ogc:Function_Name nArgs="4">in3</ogc:Function_Name><ogc:Function_Name nArgs="5">in4</ogc:Function_Name><ogc:Function_Name nArgs="6">in5</ogc:Function_Name><ogc:Function_Name nArgs="7">in6</ogc:Function_Name><ogc:Function_Name nArgs="8">in7</ogc:Function_Name><ogc:Function_Name nArgs="9">in8</ogc:Function_Name><ogc:Function_Name nArgs="10">in9</ogc:Function_Name><ogc:Function_Name nArgs="1">int2bbool</ogc:Function_Name><ogc:Function_Name nArgs="1">int2ddouble</ogc:Function_Name><ogc:Function_Name nArgs="1">interiorPoint</ogc:Function_Name><ogc:Function_Name nArgs="2">interiorRingN</ogc:Function_Name><ogc:Function_Name nArgs="2">intersection</ogc:Function_Name><ogc:Function_Name nArgs="2">intersects</ogc:Function_Name><ogc:Function_Name nArgs="1">isClosed</ogc:Function_Name><ogc:Function_Name nArgs="1">isEmpty</ogc:Function_Name><ogc:Function_Name nArgs="2">isLike</ogc:Function_Name><ogc:Function_Name nArgs="1">isNull</ogc:Function_Name><ogc:Function_Name nArgs="1">isRing</ogc:Function_Name><ogc:Function_Name nArgs="1">isSimple</ogc:Function_Name><ogc:Function_Name nArgs="1">isValid</ogc:Function_Name><ogc:Function_Name nArgs="3">isWithinDistance</ogc:Function_Name><ogc:Function_Name nArgs="1">length</ogc:Function_Name><ogc:Function_Name nArgs="2">lessEqualThan</ogc:Function_Name><ogc:Function_Name nArgs="2">lessThan</ogc:Function_Name><ogc:Function_Name nArgs="1">log</ogc:Function_Name><ogc:Function_Name nArgs="2">max</ogc:Function_Name><ogc:Function_Name nArgs="2">max_2</ogc:Function_Name><ogc:Function_Name nArgs="2">max_3</ogc:Function_Name><ogc:Function_Name nArgs="2">max_4</ogc:Function_Name><ogc:Function_Name nArgs="2">min</ogc:Function_Name><ogc:Function_Name nArgs="2">min_2</ogc:Function_Name><ogc:Function_Name nArgs="2">min_3</ogc:Function_Name><ogc:Function_Name nArgs="2">min_4</ogc:Function_Name><ogc:Function_Name nArgs="1">not</ogc:Function_Name><ogc:Function_Name nArgs="2">notEqualTo</ogc:Function_Name><ogc:Function_Name nArgs="1">numGeometries</ogc:Function_Name><ogc:Function_Name nArgs="1">numInteriorRing</ogc:Function_Name><ogc:Function_Name nArgs="1">numPoints</ogc:Function_Name><ogc:Function_Name nArgs="2">overlaps</ogc:Function_Name><ogc:Function_Name nArgs="1">parseBoolean</ogc:Function_Name><ogc:Function_Name nArgs="1">parseDouble</ogc:Function_Name><ogc:Function_Name nArgs="1">parseInt</ogc:Function_Name><ogc:Function_Name nArgs="0">pi</ogc:Function_Name><ogc:Function_Name nArgs="2">pointN</ogc:Function_Name><ogc:Function_Name nArgs="2">pow</ogc:Function_Name><ogc:Function_Name nArgs="1">PropertyExists</ogc:Function_Name><ogc:Function_Name nArgs="2">Quantile</ogc:Function_Name><ogc:Function_Name nArgs="0">random</ogc:Function_Name><ogc:Function_Name nArgs="2">relate</ogc:Function_Name><ogc:Function_Name nArgs="3">relatePattern</ogc:Function_Name><ogc:Function_Name nArgs="1">rint</ogc:Function_Name><ogc:Function_Name nArgs="1">round</ogc:Function_Name><ogc:Function_Name nArgs="1">round_2</ogc:Function_Name><ogc:Function_Name nArgs="1">roundDouble</ogc:Function_Name><ogc:Function_Name nArgs="1">sin</ogc:Function_Name><ogc:Function_Name nArgs="1">sqrt</ogc:Function_Name><ogc:Function_Name nArgs="2">StandardDeviation</ogc:Function_Name><ogc:Function_Name nArgs="1">startPoint</ogc:Function_Name><ogc:Function_Name nArgs="2">strConcat</ogc:Function_Name><ogc:Function_Name nArgs="2">strEndsWith</ogc:Function_Name><ogc:Function_Name nArgs="2">strEqualsIgnoreCase</ogc:Function_Name><ogc:Function_Name nArgs="2">strIndexOf</ogc:Function_Name><ogc:Function_Name nArgs="2">strLastIndexOf</ogc:Function_Name><ogc:Function_Name nArgs="1">strLength</ogc:Function_Name><ogc:Function_Name nArgs="2">strMatches</ogc:Function_Name><ogc:Function_Name nArgs="4">strReplace</ogc:Function_Name><ogc:Function_Name nArgs="2">strStartsWith</ogc:Function_Name><ogc:Function_Name nArgs="3">strSubstring</ogc:Function_Name><ogc:Function_Name nArgs="2">strSubstringStart</ogc:Function_Name><ogc:Function_Name nArgs="1">strToLowerCase</ogc:Function_Name><ogc:Function_Name nArgs="1">strToUpperCase</ogc:Function_Name><ogc:Function_Name nArgs="1">strTrim</ogc:Function_Name><ogc:Function_Name nArgs="2">symDifference</ogc:Function_Name><ogc:Function_Name nArgs="1">tan</ogc:Function_Name><ogc:Function_Name nArgs="1">toDegrees</ogc:Function_Name><ogc:Function_Name nArgs="1">toRadians</ogc:Function_Name><ogc:Function_Name nArgs="2">touches</ogc:Function_Name><ogc:Function_Name nArgs="1">toWKT</ogc:Function_Name><ogc:Function_Name nArgs="2">union</ogc:Function_Name><ogc:Function_Name nArgs="2">UniqueInterval</ogc:Function_Name><ogc:Function_Name nArgs="2">within</ogc:Function_Name></ogc:Function_Names></ogc:Functions></ogc:Arithmetic_Operators></ogc:Scalar_Capabilities></ogc:Filter_Capabilities></WFS_Capabilities>';
        res = parser.read(text);
        ft = res.featureTypeList.featureTypes;
        t.eq(ft.length, 14, "number of feature types correct");
        t.eq(ft[0]["abstract"], "Manhattan landmarks, identifies water, lakes, parks, interesting buildilngs", "abstract of first feature type correct");
        t.eq(ft[0]["title"], "Manhattan (NY) landmarks", "title of first feature type correct");
        t.eq(ft[0]["name"], "poly_landmarks", "name of first feature type correct");
        t.eq(ft[0]["featureNS"], "http://www.census.gov", "ns of first feature type correct");
        t.eq(ft[0]["srs"], "EPSG:4326", "srs of first feature type correct");

        var service = res.service;
        t.eq(service.name, 'WFS', "service name correct");
        t.eq(service.title, 'GeoServer Web Feature Service', "service title correct");
        t.eq(service.abstract, 'This is the reference implementation of WFS 1.0.0 and WFS 1.1.0, supports all WFS operations including Transaction.', "service title correct");
        t.eq(service.keywords[0], 'WFS', "service keyword [0] correct");
        t.eq(service.keywords[2], 'GEOSERVER', "service keyword [2] correct");
        t.eq(service.onlineResource, 'http://localhost:80/geoserver/wfs', "service onlineresource correct");
        t.ok(typeof service.fees == 'undefined', "service fees correct");
        t.ok(typeof service.accessConstraints == 'undefined', "service accessconstraints correct");
        
        t.eq(res.capability.request.getfeature.href.post, "http://localhost:80/geoserver/wfs?", "getfeature request post href correct");
        t.eq(res.capability.request.getfeature.href.get, "http://localhost:80/geoserver/wfs?request=GetFeature", "getfeature request get href correct");
        
        t.eq(res.capability.request.getfeature.formats[0], "GML2", "getfeature response format [0] correct");
        t.eq(res.capability.request.getfeature.formats[4], "GML3", "getfeature response format [4] correct");
        
        // UMN Mapserer, v1.0.0
        text =
            '<?xml version="1.0" encoding="ISO-8859-1" ?>' +
            '<WFS_Capabilities' +
            '   version="1.0.0"' +
            '   updateSequence="0"' +
            '   xmlns="http://www.opengis.net/wfs"' +
            '   xmlns:ogc="http://www.opengis.net/ogc"' +
            '   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
            '   xsi:schemaLocation="http://www.opengis.net/wfs http://ogc.dmsolutions.ca/wfs/1.0.0/WFS-capabilities.xsd">' +
            '' +
            '<!-- MapServer version 4.0 (development) OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->' +
            '' +
            '<Service>' +
            '  <Name>MapServer WFS</Name>' +
            '  <Title>GMap WMS Demo Server</Title>' +
            '  <OnlineResource>http://127.0.0.1/cgi-bin/mapserv_40?map=/msroot/apache/htdocs/gmap/htdocs/gmap75_wfs.map&amp;service=WFS&amp;</OnlineResource>' +
            '</Service>' +
            '' +
            '<Capability>' +
            '  <Request>' +
            '    <GetCapabilities>' +
            '      <DCPType>' +
            '        <HTTP>' +
            '          <Get onlineResource="http://127.0.0.1/cgi-bin/mapserv_40?map=/msroot/apache/htdocs/gmap/htdocs/gmap75_wfs.map&amp;service=WFS&amp;" />' +
            '        </HTTP>' +
            '      </DCPType>' +
            '    </GetCapabilities>' +
            '' +
            '    <DescribeFeatureType>' +
            '      <SchemaDescriptionLanguage>' +
            '        <XMLSCHEMA/>' +
            '      </SchemaDescriptionLanguage>' +
            '      <DCPType>' +
            '        <HTTP>' +
            '          <Get onlineResource="http://127.0.0.1/cgi-bin/mapserv_40?map=/msroot/apache/htdocs/gmap/htdocs/gmap75_wfs.map&amp;service=WFS&amp;" />' +
            '        </HTTP>' +
            '      </DCPType>' +
            '' +
            '    </DescribeFeatureType>' +
            '    <GetFeature>' +
            '      <ResultFormat>' +
            '        <GML2/>' +
            '      </ResultFormat>' +
            '      <DCPType>' +
            '        <HTTP>' +
            '          <Get onlineResource="http://127.0.0.1/cgi-bin/mapserv_40?map=/msroot/apache/htdocs/gmap/htdocs/gmap75_wfs.map&amp;service=WFS&amp;" />' +
            '        </HTTP>' +
            '' +
            '      </DCPType>' +
            '    </GetFeature>' +
            '  </Request>' +
            '</Capability>' +
            '' +
            '<FeatureTypeList>' +
            '  <Operations>' +
            '    <Query/>' +
            '  </Operations>' +
            '    <FeatureType>' +
            '' +
            '        <Name>park</Name>' +
            '        <Title>Parks</Title>' +
            '        <SRS>EPSG:42304</SRS>' +
            '        <LatLongBoundingBox minx="-173.433" miny="41.4271" maxx="-13.3643" maxy="83.7466" />' +
            '    </FeatureType>' +
            '    <FeatureType>' +
            '        <Name>popplace</Name>' +
            '' +
            '        <Title>Cities</Title>' +
            '        <SRS>EPSG:42304</SRS>' +
            '        <LatLongBoundingBox minx="-172.301" miny="36.3541" maxx="-12.9698" maxy="83.4832" />' +
            '    </FeatureType>' +
            '</FeatureTypeList>' +
            '' +
            '<ogc:Filter_Capabilities>' +
            '  <ogc:Spatial_Capabilities>' +
            '    <ogc:Spatial_Operators>' +
            '' +
            '      <ogc:BBOX/>' +
            '    </ogc:Spatial_Operators>' +
            '  </ogc:Spatial_Capabilities>' +
            '  <!-- Provide some ScalarCapabilties just for the XML to validate against the schema even if we don\'t support any.  (Yes this is stupid!) -->' +
            '  <ogc:Scalar_Capabilities>' +
            '    <ogc:Logical_Operators />' +
            '  </ogc:Scalar_Capabilities>' +
            '</ogc:Filter_Capabilities>' +
            '' +
            '</WFS_Capabilities>';
        res = parser.read(text);
        var ft = res.featureTypeList.featureTypes;
        t.eq(ft.length, 2, "number of feature types correct");
        t.eq(ft[0]["title"], "Parks", "title of first feature type correct");
        t.eq(ft[0]["name"], "park", "name of first feature type correct");
        t.eq(ft[0]["srs"], "EPSG:42304", "srs of first feature type correct");
        
        var service = res.service;
        t.eq(service.name, 'MapServer WFS', "service name correct");
        t.eq(service.title, 'GMap WMS Demo Server', "service title correct");
        t.eq(service.onlineResource, 'http://127.0.0.1/cgi-bin/mapserv_40?map=/msroot/apache/htdocs/gmap/htdocs/gmap75_wfs.map&service=WFS&', "service onlineresource correct");
        t.eq(res.capability.request.getfeature.href.get, "http://127.0.0.1/cgi-bin/mapserv_40?map=/msroot/apache/htdocs/gmap/htdocs/gmap75_wfs.map&service=WFS&", "getfeature request get href correct");
        t.eq(res.capability.request.getfeature.formats[0], "GML2", "getfeature response format [0] correct");        
    }

    </script> 
</head> 
<body>
</body> 
</html>
